<?php



require "database.php";


require "../config/config.php";

$base=new Db($__conf__);

$token=$_POST['token'];

$___r___=$base->doSql('select id from tp_user where token="'.$token.'"');
if ($___r___) {
	$___r___=$___r___[0];
	$list=$base->doSql('select * from tp_order where uid="'.$___r___["id"].'" and status=1 order by id desc');
	return json([
		"code"=>200,
		"msg"=>"Successful",
		"requestDate"=>date("Y-m-d H:i:s"),
		"data"=>$list
	]);
}else{
	return json([
		"code"=>400,
		"msg"=>"System Error",
		"requestDate"=>date("Y-m-d H:i:s"),
		"data"=>null
	]);
}



